package com.analysis.enums;

import java.util.Arrays;
import java.util.List;

/**
 * @Date 2025/8/29
 * @Author 蒋棒
 */
public enum ModelChatClientEnum {

    DEEPSEEK("deepseek", "deepseek-chat", "DeepSeek", Arrays.asList("deepseek", "DeepSeek", "deepSeek")),
    DOUBAO("doubao", "doubao-web", "豆包", Arrays.asList("豆包", "doubao", "抖音")),
    YUANBAO("yuanbao", "hunyuan-lite", "腾讯元宝", Arrays.asList("腾讯", "元宝", "yuanbao")),
    QWEN("qwen", "qwen3", "通义千问", Arrays.asList("通义", "千问", "阿里", "qwen", "qianwen")),
    BAIDU("baidu", "baidu", "文心一言", Arrays.asList("文心一言", "百度", "baidu")),
    KIMI("kimi", "kimi-latest", "KIMI", Arrays.asList("KIMI", "kimi")),
    ;

    private String source;
    private String model;
    private String name;
    private List<String> excelName;

    ModelChatClientEnum(String source, String model, String name, List<String> excelName) {
        this.source = source;
        this.model = model;
        this.name = name;
        this.excelName = excelName;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getName() {
        return name;
    }

    public List<String> getExcelName() {
        return excelName;
    }

    public void setExcelName(List<String> excelName) {
        this.excelName = excelName;
    }

    public static String getName(String source) {
        for (ModelChatClientEnum modelChatClientEnum : ModelChatClientEnum.values()) {
            if (modelChatClientEnum.getSource().equals(source)) {
                return modelChatClientEnum.getName();
            }
        }
        return source;
    }

    public static String getSource(String excelName) {
        for (ModelChatClientEnum modelChatClientEnum : ModelChatClientEnum.values()) {
            for (String name : modelChatClientEnum.getExcelName()) {
                if (excelName != null && excelName.contains(name)) {
                    return modelChatClientEnum.getSource();
                }
            }
        }
        return null;
    }
}
